<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head th:replace="_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>LENSTAR</title>
    <link href="../static/images/avatar.jpg" rel="icon" type="image/x-ico">
    <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
    <link rel="stylesheet" type="text/css" href="../static/css/myStyle.css">
</head>
<body>
    <!--导航-->
    <!--<nav id="nav" th:replace="_fragments :: menu(1)" class="ui inverted attached m-padded-tb-mini">-->
    <nav id="nav" th:replace="_fragments :: menu(1)" class="gird-header">
        <div class="ui container">
            <div class="ui inverted secondary stackable menu">
                <h2 class="ui olive header item" style="font-family: STSong">LENSTAR</h2>
                <!--<div class="right m-item item m-mobile-hide">-->
                <a href="./index.html" class="m-item item m-mobile-hide"><i class="home icon"></i>首页</a>
                <a href="types.html" class="m-item item m-mobile-hide"><i class="clone outline icon"></i>分类</a>
                <a href="tags.html" class="m-item item m-mobile-hide"><i class="tags icon"></i>标签</a>
                <a href="archives.html" class="m-item item m-mobile-hide"><i class="align justify icon"></i>归档</a>
                <a href="about.html" class="m-item item m-mobile-hide"><i class="info icon"></i>关于我</a>
                <!--</div>-->
                <div class="m-item right item m-mobile-hide">
                    <form name="search" action="#" th:action="@{/search}" method="post" target="_blank">
                        <div class="ui icon transparent inverted input">
                            <input type="text" name="query" placeholder="Search...." value="" th:value="${query}">
                            <i class="search link icon"></i>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <a href="#" class="ui menu toggle button m-right-top m-mobile-show" style="background-color: rgba(0,0,0,0); color: gainsboro">
            <i class="sidebar icon"></i>
        </a>
    </nav>

    <br>
    <br>
    <br>
    <!--中间内容-->
    <div class="m-padded-tb-large">
        <div class="ui container m-opacity">
            <div class="ui stackable grid">
                <!--左边博客列表-->
                <div class="eleven wide column">
                    <!--header-->
                    <div class="ui top attached segment">
                        <div class="ui middle aligned two column grid">
                            <div class="column">
                                <h3 class="ui teal header">博客</h3>
                            </div>
                            <div class="right aligned column">
                                共 <h3 class="ui orange header m-inline-block m-text-thin" th:text="${pageInfo.total}">14</h3> 篇
                            </div>
                        </div>
                    </div>
                    <!--content-->
                    <div class="ui padded segment m-padded-tb-large" th:each="blog : ${pageInfo.list}">
                        <div class="ui middle alined mobile reversed stackable grid">
                            <div class="eleven wide column">
                                <a th:href="@{/blog/{id}(id=${blog.id})}" >
                                    <h3 class="ui header" th:text="${blog.title}">Java从入门到放弃</h3>
                                </a>

                                <p class="m-text" th:text="${blog.description}" style="margin-top: 14px; margin-left: 14px; text-indent:30px;" >本文将从服务器购买后远程连接，环境搭建，项目部署运行和域名访问来讲述SpringBoot搭建个人博客的线上部署，每一个步骤都有详细的说明，这一篇结束后，【SpringBoot搭建个人博客】所有功能都已完成，可以进行访问了......</p>
                                <div class="ui grid">
                                    <div class="eleven wide column">
                                        <div class="ui horizontal link list">
                                            <div class="item">
                                                <img src="../static/images/avatar.jpg" th:src="@{${blog.avatar}}"  alt="" class="ui avatar image">
                                                <div class="content"><a href="" th:href="@{/about}" class="header">LENSTAR</a></div>
                                            </div>
                                            <!--createTime-->
                                            <div class="item">
                                                <i class="calendar icon"></i><span th:text="${#dates.format(blog.createTime,'yyyy-MM-dd')}">2020-07-20</span>
                                            </div>
                                            <!--views-->
                                            <div class="item">
                                                <i class="eye icon"></i> <span th:text="${blog.views}">123</span>
                                            </div>
                                            <!--comment_count-->
                                            <div class="item">
                                                <i class="comment outline icon"></i> <span th:text="${blog.commentCount}">8</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="right aligned five wide column">
                                        <a href="" class="ui teal label basic m-padded-mini m-text-thin" th:text="${blog.typeName}">认知升级</a>
                                    </div>
                                </div>
                            </div>

                            <div class="five wide column">
                                <a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank">
                                    <img src="" th:src="@{${blog.firstPicture}}" alt="" class="ui rounded image">
                                </a>
                            </div>
                        </div>
                    </div>
                    <!--footer 分页-->
                    <div class="ui bottom attached segment">
                        <div class="ui middle aligned three column grid">
                            <div class="column">
                                <a href="#" th:href="@{/(pageNum=${pageInfo.hasPreviousPage}?${pageInfo.prePage}:1)}" class="ui mini teal basic button">上一页</a>
                            </div>
                            <div class="center aligned column" align="center">
                                <p> <span th:text="${pageInfo.pageNum}"></span> / <span th:text="${pageInfo.pages}"></span> </p>
                            </div>
                            <div class="right aligned column">
                                <a href="#" th:href="@{/(pageNum=${pageInfo.hasNextPage}?${pageInfo.nextPage}:${pageInfo.pages})}" class="ui mini teal basic button">下一页</a>
                            </div>
                        </div>
                    </div>
                </div>

                <!--右边的top-->
                <div class="five wide column">
                    <!--分类-->
                    <div class="ui segments">
                        <div class="ui secondary segment">
                            <div class="ui two column grid">
                                <div class="column">
                                    <i class="clone outline icon"></i> 分类
                                </div>
                                <div class="right aligned column">
                                    <a href="" th:href="@{/types/-1}">更多 <i class="angle double down icon"></i></a>
                                </div>
                            </div>
                            <div class="ui teal segment" style="background-color: rgba(255, 255, 255, 0) !important;">
                                <div class="ui fluid vertical menu" style="background-color: rgba(255, 255, 255, 0) !important;">
                                    <a href="" th:href="@{/types/{id}(id=${type.id})}" class="item" th:each="type : ${types}">
                                        <span th:text="${type.name}">学习日志</span>
                                        <div class="ui teal basic left pointing label" th:text="${#arrays.length(type.blogList)}">13</div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--标签-->
                    <div class="ui segments m-margin-tb-big">
                        <div class="ui secondary segment">
                            <div class="ui two column grid">
                                <div class="column">
                                    <i class="tags icon"></i> 标签
                                </div>
                                <div class="right aligned column">
                                    <a href="" th:href="@{/tags/-1}">更多 <i class="angle double down icon"></i></a>
                                </div>
                            </div>
                            <div class="ui teal segment" style="background-color: rgba(255, 255, 255, 0) !important;">
                                <a href="" th:href="@{/tags/{id}(id=${tag.id})}" th:each="tag : ${tags}" class="ui teal basic left pointing label m-margin-tb-tiny">
                                    <span th:text="${tag.name}">MySQL</span> <div class="detail" th:text="${#arrays.length(tag.blogList)}">23</div>
                                </a>
                            </div>
                        </div>
                    </div>
                    <!--阅读排行榜-->
                    <div class="ui segments m-margin-tb-big">
                        <div class="ui secondary segment">
                            <div class="ui two column grid">
                                <div class="column">
                                    <i class="sort amount up icon"></i> 阅读排行榜
                                </div>
                                <div class="right aligned column">
                                    <a href="" th:href="@{/archives}">更多 <i class="angle double down icon"></i></a>
                                </div>
                            </div>
                            <div class="ui teal segment" style="background-color: rgba(255, 255, 255, 0) !important;">
                                <div class="ui fluid vertical menu" style="background-color: rgba(255, 255, 255, 0) !important;">
                                    <a href="" th:href="@{/blog/{id}(id=${blog.id})}" th:each="blog : ${blogTop}" class="item">
                                        <span  th:text="${blog.title}"> MySQL(一)</span>
                                        <div class="ui teal basic left pointing label"><i class="eye icon"></i><span th:text="${blog.views}">10</span> </div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!--底部栏-->
    <footer class="ui inverted vertical m-padded-tb-massive">
        <div class="ui center aligned container">
            <div class="ui inverted divided stackable grid">
                <div class="four wide column">
                    <img src="../static/images/wechat.jpg" th:src="@{/images/wechat.jpg}" alt="" style="width: 100px;">
                </div>
                <div class="four wide column">
                    <h4 class="ui inverted header m-text-spaced m-text-thin">最新博客</h4>
                    <div class="ui inverted link list">
                        <a id="newBlog-1" href="" class="item">Java（User Story）</a>
                        <a id="newBlog-2" href="" class="item">Linux（User Story）</a>
                        <a id="newBlog-3" href="" class="item">Redis（User Story）</a>
                    </div>
                </div>
                <div class="four wide column">
                    <h4 class="ui inverted header m-text-spaced m-text-thin">联系我</h4>
                    <div class="ui inverted link list">
                        <a href="" class="item">邮箱：XX181028@163.com</a>
                        <a href="" class="item">QQ：1412265423</a>
                    </div>
                </div>
                <div class="four wide column">
                    <h4 class="ui inverted header m-text-spaced m-text-thin">LENSTAR</h4>
                    <p class="m-text-spaced m-text-thin m-opacity-mini" style="color: gainsboro">
                        这是我的个人博客，会分享我所学到的任何知识，希望和大家一起共同进步.....
                    </p>
                </div>
            </div>
            <div class="ui inverted section divider"></div>
            <p class="m-text-spaced m-text-thin m-opacity-mini" style="color: gainsboro">
                Copyright © 2020-2021 LENSTAR Designed by LENSTAR
            </p>
        </div>
    </footer>

<!--/*/<th:block th:replace="_fragments :: script">/*/-->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
<!--/*/</th:block>/*/-->

<script>
    // 点击按钮触发事件
    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide');
    });

    // 最新博客
    function newBlog() {
        $.get({
            url:/*[[@{/newBlog}]]*/"/newBlog",
            success:function (data) {
                //这里的data是后台传来的数据
                document.getElementById("newBlog-1").innerText = data[0].title;
                document.getElementById("newBlog-2").innerText = data[1].title;
                document.getElementById("newBlog-3").innerText = data[2].title;
                document.getElementById("newBlog-1").href = "/blog/"+data[0].id;
                document.getElementById("newBlog-2").href = "/blog/"+data[1].id;
                document.getElementById("newBlog-3").href = "/blog/"+data[2].id;
            }
        });
    }
    newBlog();


</script>

</body>
</html>